import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        while (sc.hasNext()){
            int n=Integer.parseInt(sc.nextLine());
            StringBuilder sb=new StringBuilder();
            while (n>0){
                String str=sc.nextLine();
                if (str.contains(",")||str.contains(" ")){
                    sb.append("\""+str+"\"");
                }
                else
                    sb.append(str);
                if (n!=1){
                    sb.append(", ");
                }
                n--;
            }
            System.out.println(sb);
        }
    }
}
